<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/inc/taglibs.jsp"%>
<script type="text/javascript">
function processBack(response){
	alertMsg.correct(response.message);
	 $.pdialog.closeCurrent();
	 navTab.reload("${path }/admin/userMessageDm", "");
}
</script>
<c:choose>
	<c:when test="${model.id==0 ||empty model.id}">
		<c:set var="action" value="${path }/admin/userMessageDmContent/add.do"></c:set>
	</c:when>
	<c:otherwise>
		<c:set var="action" value="${path }/admin/userMessageDmContent/update.do"></c:set>
	</c:otherwise>
</c:choose>
<div class="pageContent">
	<form method="post" action="${action }" class="pageForm required-validate" onsubmit="return validateCallback(this, processBack);">
<div class="pageFormContent" layoutH="58">
			<p class="nowrap">
            	<label>标题：</label>
            	<input type="hidden" name="dmId" value="${dmId }" />
            	<input type="hidden" name="id" value="${model.id }" />
				<input name="subject" type="text"  value="${model.subject }"  />            
			</p>
						<div class="unit">
						 <textarea id="content" name="content" rows="30" style="width:100%; border: 1px">${model.content }</textarea>  
						</div>
					</div>
					<div class="formBar">
						<ul>
						<c:if test="${view !=1 }">
							<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
						</c:if>
							<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
						</ul>
					</div>
	</form>
</div>
<script type="text/javascript">  
        $(document).ready(function(){  
            //初始化xhEditor编辑器插件  
            $('#content').xheditor({  
            	tools:'mini',  
                skin:'default',  
                upMultiple:true,  
                upImgUrl: "/admin/images/xh/upload.json",  
                upImgExt: "jpg,jpeg,gif,bmp,png",  
                onUpload:insertUpload1,  
                html5Upload:false  
            });  
            //xbhEditor编辑器图片上传回调函数  
            function insertUpload1(msg) {  
                var _msg = msg.toString();  
                $("#content").append(_msg);  
            }
        });  
    </script>  